<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
</head>
<body>
<div id="app">
    <cpn-item :msg="fmsg" :arr="farr"></cpn-item>
</div>
<template id="tmpl">
    <div>
        <p>{{msg}}</p>
        <p>{{arr}}</p>
    </div>
</template>
<script src="./js/vue-2.5.16.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    //注册组件
    //父组件通过props向子组件传值
    Vue.component("cpn-item",{
        template:"#tmpl",
        props:["msg","arr"]
    })
    var vm = new Vue({
        el:"#app",
        data:{
            fmsg:"父组件内容",
            farr:["a","b","c"]
        },
        methods:{

        },
    })
</script>
</body>
</html>
